﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="AgriMarketWebProj.AgriMarketService" %>
<%@ Import Namespace="AgriMarketWebProj.Models" %>
<%@ Import Namespace="System.Web.Script.Serialization" %>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
    AgriMarket|Tìm kiếm
</asp:Content>

<asp:Content ID="ScriptContent" ContentPlaceHolderID="ScriptContent" runat="server">
    <script src="../../Scripts/AgriProj/Auction/AuctionView.js" type="text/javascript"></script>
    <link href="../../Content/Auction/SearchAuctionView.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">
    <div class="SearchTitle">
        <span class="SearchTitleSpan">Tất cả kết quả</span>
    </div>
	<%
        List<Auction> result = Model;
        if (result != null)
        {
            foreach (var auction in result)
            {
                %>
        <div class="SearchAutionClass">
		    <div class="InfoSearchSmallAuctionnerDiv">	
			    <%="<a href='/Auction/ViewAuctionDetails?auctionId="+auction.AuctionId+"'>"%>
			    <%="<img src='"+ServiceURL.ServicePath+auction.ProductImage+"' class='InforSearchIimageSmallAuction'>"%>
			    </a>
		    </div>
		    <div class="InfoSearch">
			    <div class="InfoSearchTopic">
                    <%="<a href='/Auction/ViewAuctionDetails?auctionId="+auction.AuctionId+"' class='TopicName InfoSearchFont'>"%>
				        <%=auction.Topic %>
                    </a>
			    </div>
			    <div class="AuctioneerName">
				    <a class="NameAuctioneerComment InfoSearchFont" href="#"><%=auction.AuthorId %></a>
			    </div>
			    <div class="InfoSearchPrice fontSearchPriceAnhDetail"><%=auction.InitialPrice %></div>
			    <div class="Detail fontSearchPriceAnhDetail">Chi tiết: <%=auction.ProductDescription.Substring(0,auction.ProductDescription.Length>=200?200:auction.ProductDescription.Length) %></div>
		    </div>
 	    </div>
        <%
            }
        }
        else {
            Response.Write("Không tìm thấy kết quả");
        }
        %>
</asp:Content>

            